package itqf.service;



import itqf.dao.ItemDaoImpl;
import itqf.dao.OrdersDaoImpl;
import itqf.dao.impl.ItemDao;
import itqf.dao.impl.OrdersDao;
import itqf.entity.Item;
import itqf.entity.Orders;
import itqf.service.impl.OrderDetailService;

import java.util.List;

/**
 * com.itqf.service
 * 2020/9/17
 */
public class OrderDetailServiceImpl implements OrderDetailService {
    private OrdersDao ordersDao = new OrdersDaoImpl();
    private ItemDao itemDao = new ItemDaoImpl();
    @Override
    public Orders findOrderAndDetail(String oid) {
        Orders orderDetailByOid = ordersDao.findOrderDetailByOid(oid);
        List<Item> itemByOid = itemDao.findItemByOid(oid);
        orderDetailByOid.setItemList(itemByOid);
        return orderDetailByOid;
    }
}
